package org.wanghong.gift.client;

import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.wanghong.gift.dto.RegisterPhoneValidateDto;
import org.wanghong.gift.util.AjaxResult;
@FeignClient(value = "gift-common",fallbackFactory =SmsValidateCodeClientFallbackFactory.class )
public interface SmsValidateCodeClient {
    //暴露短信验证码接口，给其他服务进行调用
    @GetMapping("/sms/{phone}")
    public AjaxResult sendRegisterCode(@PathVariable("phone") String phone);
     //注册接口暴露
    @PostMapping("/sms/validate")
    AjaxResult validateRegisterCode(@RequestBody RegisterPhoneValidateDto dto);
}